﻿var app = angular.module("starter");

app.factory('$tianditu', [
     "$q",
     "$rootScope",
     "$http",
     "baseurl",
    function ($q, $rootScope, $http, baseurl) {
        
        var getCurrentPosition = function () {

            var q = $q.defer();
            var lo = new T.Geolocation();
            lo.getCurrentPosition(function (e) {
                q.resolve(e);
            }, function (err) {
                q.reject(err);
            });

            return q.promise;
        }

        return {
            getCurrentPosition: getCurrentPosition
        };

    }]);